<%@ page language="java" contentType="text/html; charset=UTF-8"
  pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="<%=request.getContextPath()%>/css/base.css" rel="stylesheet" type="text/css" />
<link href="<%=request.getContextPath()%>/css/admin.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery.validate.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery.validate.methods.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/base.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/admin.js"></script>
<script src="<%=request.getContextPath()%>/js/jquery.uploadify.v2.1.4.min.js" type="text/javascript"></script>
<script src="<%=request.getContextPath()%>/js/swfobject.js" type="text/javascript"></script>
<link href="<%=request.getContextPath()%>/js/uploadify.css" rel="stylesheet" type="text/css" />
</head>


<BODY class="input"><DIV class=bar>
<c:if test="${kind==1}">疯狂抢购</c:if>
<c:if test="${kind==2}">猜您喜欢</c:if>
<c:if test="${kind==3}">热卖商品</c:if>
<c:if test="${kind==4}">新品推荐</c:if> </DIV>
<div id="validateErrorContainer" class="validateErrorContainer">
	<div class="validateErrorTitle">以下信息填写有误,请重新填写</div>
	<ul></ul>
</div>

<DIV class=body>
<FORM id=indexGroupForm  method=post action=indexgroupsave.do>
<TABLE  class="inputTable" >
<TBODY>
<TR class=noneHover>
<TD ><INPUT type="button" value="选择商品" onclick="openGoodsSelect()" />   </TD>

<TD>图片名称：<input type="text" name="imgName" id="imgName" value="${adv.imgName}" readonly/></TD></TR>
<TR>
<TD ><img class=advimg src="<%=request.getContextPath()%>/images/admin/base_overlay_bg.png" width="500px" height="250px"></TD>

<TD>
 <TABLE>
   <TR><TD>主链接：</TD><TD><INPUT class=formText style="width:280px"  type=text maxlength="50" name=link value=${adv.link}></TD></TR>
   <TR><TD>link1：</TD><TD><INPUT class=formText style="width:280px"  type=text maxlength="50" name=link1 value=${adv.link1}></TD></TR>
   <TR><TD>link2：</TD><TD><INPUT class=formText style="width:280px"  type=text maxlength="50" name=link2 value=${adv.link2}></TD></TR>
   <TR><TD>link3：</TD><TD><INPUT class=formText style="width:280px"  type=text maxlength="50" name=link3 value=${adv.link3}></TD></TR>
   <TR><TD>link4：</TD><TD><INPUT class=formText style="width:280px"  type=text maxlength="50" name=link4 value=${adv.link4}></TD></TR>
   <TR><TD>排序:<INPUT class=formText style="width:10px" maxlength="1" type=text name=sort value=${adv.sort}></TD>
   <TD>是否显示:<SELECT name=status id=status> 
     <OPTION selected value="1" >是</OPTION> <OPTION value="0" >否</OPTION></SELECT>
     </TD>
   </TR>
 </TABLE>
</TD>


</TR>
</TBODY>
</TABLE>
<DIV class=buttonArea><INPUT hideFocus class=formButton value="确  定" type=submit>&nbsp;&nbsp; <INPUT hideFocus class=formButton onclick="back()" value="返  回" type=button> </DIV>
</FORM>
</DIV>

<DIV id="goodsSelect" style="Z-INDEX: 103; WIDTH: 800px; DISPLAY: none; HEIGHT: 400px; MARGIN-LEFT: -400px;top:5%"  class=baseDialog >
      <DIV class=dialogWrap></DIV>
      <DIV class=dialogMain>
        <div  class="dialogTitle" style="height:30px;line-height:35px">添加商品到
        <c:if test="${kind==1}">疯狂抢购</c:if>
		<c:if test="${kind==2}">猜您喜欢</c:if>
		<c:if test="${kind==3}">热卖商品</c:if>
		<c:if test="${kind==4}">新品推荐</c:if></div><DIV class=dialogClose onclick="closeGoods()"></DIV>
        <DIV style="padding:10px"><IFRAME height=345 frameborder="no"  src="goodsselect.do" width=750 align=center></IFRAME></DIV>
     </DIV>
</DIV>
</BODY>

<script type="text/javascript">
$().ready(function() {	  
    var $validateErrorContainer = $("#validateErrorContainer");
	var $validateErrorLabelContainer = $("#validateErrorContainer ul");
   // 表单验证
	$("#advForm").validate({
	    errorContainer: $validateErrorContainer,
		errorLabelContainer: $validateErrorLabelContainer,
		wrapper: "span",	   
		errorClass: "validateError",   
		rules: {
			imgName: "required",
			link: "required",	
			link1: "required",
			link2: "required",
			link3: "required",
			link4: "required",	
			sort: {required: true,digits: true}		
		},
		messages: {
			imgName: "请上传广告图片!",
			link: "请填写主链接!",	
			link1:"请填写link1!",
			link2:"请填写link2!",		
			link3:"请填写link3!",
			link4:"请填写link4!",	
			sort:{required:"请填写广告排序!",digits:"请填写合法的数字!"}
		},
		submitHandler: function(form) {			   
			$(form).find(":submit").attr("disabled", true);
			form.submit();
		}
	});	
})

function back()
{
  window.history.back(); return false;
}
function openGoodsSelect()
{
   $("#goodsSelect").show();
  }
function closeGoods()
{
  $("#goodsSelect").hide();
}
</script>
</html>